
import os
import re
import json
project_path = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))

properties = []
with open(os.path.join(project_path, "data", "get_property_from_excel.md"), 'r', encoding='utf-8') as fp:
    for line in fp:
        re_res = re.search("\*{2,3}(.+?)\*{2,3}", line)
        if re_res is not None:
            properties.append(re_res.group(1))

with open(os.path.join(project_path, "data", "properties.json"), 'w', encoding='utf-8') as fp:
    json.dump(properties, fp, ensure_ascii=False, indent=2)
